package com.softer.chengxin.score.controller;

import com.softer.chengxin.score.service.NewTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Gong Zhiyang
 * @date 2019/2/15
 */
@RestController
@RequestMapping("/api/ScoreDetail")
public class NewTypeController {
    @Autowired
    private NewTypeService newTypeService;

    /**
     * 新增优良负面类型
     *
     * @return 结果
     */
    @PostMapping("/addNewTypeScore")
    public void addScore() {
        newTypeService.addScore();
    }

    /**
     * 更新企业分数
     */
    @PostMapping("/updateScore")
    public void updateScore() {
        newTypeService.updateScore();
    }

    /**
     * 手动调用
     * 更新所有企业分数
     */
    @PostMapping("/updateCorpScore")
    public void updateCorpScore() {
        newTypeService.updateCorpScore();
    }
}
